<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>发现动态 - 社交平台</title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    <style>
        :root {
            --primary: #4263eb;
            --primary-light: #eef0ff;
            --secondary: #36b37e;
            --light-gray: #f8f9fa;
            --dark-gray: #343a40;
            --text-gray: #6c757d;
            --border-color: #e9ecef;
            --danger: #e74c3c;
        }
        
        body {
            background-color: #f3f4f6;
            font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
            color: #333;
            line-height: 1.6;
        }
        
        .container {
            max-width: 1200px;
        }
        
        /* 头部样式 */
        .site-header {
            background-color: white;
            border-bottom: 1px solid var(--border-color);
            position: sticky;
            top: 0;
            z-index: 100;
        }
        
        .logo {
            font-size: 1.5rem;
            font-weight: 700;
            color: var(--primary);
            text-decoration: none;
        }
        
        .search-bar {
            max-width: 400px;
            width: 100%;
        }
        
        .search-input {
            background-color: var(--light-gray);
            border: none;
            padding: 0.5rem 1rem;
            border-radius: 20px;
            width: 100%;
        }
        
        .search-input:focus {
            outline: none;
            box-shadow: 0 0 0 2px rgba(66, 99, 235, 0.2);
        }
        
        .nav-links .nav-link {
            color: var(--dark-gray);
            font-weight: 500;
            margin-left: 1.5rem;
            transition: color 0.2s;
        }
        
        .nav-links .nav-link:hover,
        .nav-links .nav-link.active {
            color: var(--primary);
        }
        
        .avatar {
            width: 38px;
            height: 38px;
            border-radius: 50%;
            object-fit: cover;
            cursor: pointer;
        }
        
        /* 主体内容 */
        .main-content {
            padding: 2rem 0;
        }
        
        /* 动态卡片样式 */
        .feed-card {
            background-color: white;
            border-radius: 12px;
            box-shadow: 0 1px 3px rgba(0,0,0,0.05);
            margin-bottom: 1.5rem;
            overflow: hidden;
            transition: transform 0.2s, box-shadow 0.2s;
        }
        
        .feed-card:hover {
            transform: translateY(-2px);
            box-shadow: 0 4px 12px rgba(0,0,0,0.08);
        }
        
        .feed-header {
            padding: 1rem 1.5rem;
            display: flex;
            align-items: center;
            gap: 1rem;
        }
        
        .user-info {
            flex-grow: 1;
        }
        
        .user-name {
            font-weight: 600;
            color: var(--dark-gray);
            text-decoration: none;
        }
        
        .user-name:hover {
            color: var(--primary);
        }
        
        .post-time {
            font-size: 0.85rem;
            color: var(--text-gray);
        }
        
        .feed-content {
            padding: 0 1.5rem 1rem;
        }
        
        .post-text {
            margin-bottom: 1rem;
            line-height: 1.8;
        }
        
        /* 图片布局 */
        .post-images {
            margin-bottom: 1rem;
            border-radius: 8px;
            overflow: hidden;
        }
        
        .single-image {
            width: 100%;
            max-height: 500px;
            overflow: hidden;
        }
        
        .single-image img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            transition: transform 0.3s ease;
        }
        
        .single-image:hover img {
            transform: scale(1.02);
        }
        
        .two-images {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 4px;
        }
        
        .three-images {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 4px;
        }
        
        .three-images img:first-child {
            grid-column: 1 / 2;
            grid-row: 1 / 3;
        }
        
        .four-images {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 4px;
        }
        
        .five-plus-images {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 4px;
        }
        
        .image-item {
            position: relative;
            height: 0;
            padding-bottom: 100%;
            overflow: hidden;
        }
        
        .image-item img {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            object-fit: cover;
            transition: transform 0.3s ease;
        }
        
        .image-item:hover img {
            transform: scale(1.05);
        }
        
        .image-overlay {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-color: rgba(0, 0, 0, 0.5);
            color: white;
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: 600;
        }
        
        /* 动态操作区 */
        .feed-actions {
            padding: 0.75rem 1.5rem;
            border-top: 1px solid var(--border-color);
            display: flex;
            justify-content: space-around;
        }
        
        .action-btn {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            background: none;
            border: none;
            color: var(--text-gray);
            font-size: 0.9rem;
            padding: 0.3rem 0.75rem;
            border-radius: 4px;
            cursor: pointer;
            transition: all 0.2s;
        }
        
        .action-btn:hover {
            background-color: var(--primary-light);
            color: var(--primary);
        }
        
        .action-btn.liked {
            color: var(--danger);
        }
        
        .action-btn.saved {
            color: var(--secondary);
        }
        
        /* 推荐标签 */
        .feed-tags {
            padding: 0 1.5rem 1rem;
        }
        
        .tag {
            display: inline-block;
            padding: 0.25rem 0.75rem;
            background-color: var(--primary-light);
            color: var(--primary);
            border-radius: 20px;
            font-size: 0.85rem;
            text-decoration: none;
            margin-right: 0.5rem;
            margin-bottom: 0.5rem;
            transition: all 0.2s;
        }
        
        .tag:hover {
            background-color: var(--primary);
            color: white;
        }
        
        /* 布局切换器 */
        .layout-switcher {
            margin-bottom: 1.5rem;
            padding: 0.75rem;
            background-color: white;
            border-radius: 8px;
            display: flex;
            align-items: center;
            gap: 1rem;
        }
        
        .switcher-label {
            font-weight: 500;
            color: var(--dark-gray);
        }
        
        .view-options {
            display: flex;
            gap: 0.5rem;
        }
        
        .view-btn {
            width: 36px;
            height: 36px;
            border-radius: 6px;
            border: 1px solid var(--border-color);
            background-color: white;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            transition: all 0.2s;
        }
        
        .view-btn.active {
            background-color: var(--primary);
            color: white;
            border-color: var(--primary);
        }
        
        /* 网格布局 */
        .grid-layout {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
            gap: 1.5rem;
        }
        
        .grid-card {
            display: flex;
            flex-direction: column;
            height: 100%;
        }
        
        .grid-content {
            flex-grow: 1;
            display: flex;
            flex-direction: column;
        }
        
        .grid-footer {
            margin-top: auto;
        }
        
        /* 紧凑布局 */
        .compact-card {
            display: flex;
            align-items: flex-start;
            gap: 1rem;
        }
        
        .compact-avatar {
            flex-shrink: 0;
        }
        
        .compact-content {
            flex-grow: 1;
        }
        
        .compact-images {
            max-width: 200px;
            border-radius: 8px;
            overflow: hidden;
        }
        
        /* 响应式设计 */
        @media (max-width: 992px) {
            .grid-layout {
                grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
            }
        }
        
        @media (max-width: 768px) {
            .search-bar {
                max-width: 200px;
            }
            
            .nav-text {
                display: none;
            }
            
            .nav-links .nav-link {
                margin-left: 1rem;
            }
            
            .compact-card {
                flex-direction: column;
            }
            
            .compact-images {
                max-width: 100%;
                width: 100%;
            }
        }
        
        @media (max-width: 576px) {
            .search-bar {
                display: none;
            }
            
            .feed-actions {
                justify-content: space-between;
            }
            
            .action-text {
                display: none;
            }
            
            .action-btn {
                gap: 0;
                padding: 0.3rem;
            }
            
            .five-plus-images {
                grid-template-columns: repeat(2, 1fr);
            }
        }
    </style>
</head>
<body>
    <!-- 网站头部 -->
    <header class="site-header py-3">
        <div class="container">
            <div class="d-flex justify-content-between align-items-center">
                <a href="#" class="logo">SocialHub</a>
                
                <div class="search-bar">
                    <input type="text" class="search-input" placeholder="搜索动态、话题或用户...">
                </div>
                
                <nav class="nav-links d-flex align-items-center">
                    <a href="#" class="nav-link">
                        <i class="fas fa-home me-1"></i>
                        <span class="nav-text">首页</span>
                    </a>
                    <a href="#" class="nav-link active">
                        <i class="fas fa-compass me-1"></i>
                        <span class="nav-text">发现</span>
                    </a>
                    <a href="#" class="nav-link">
                        <i class="fas fa-bell me-1"></i>
                        <span class="nav-text">通知</span>
                    </a>
                    <a href="#" class="nav-link">
                        <i class="fas fa-envelope me-1"></i>
                        <span class="nav-text">消息</span>
                    </a>
                    <img src="https://picsum.photos/100/100?random=1" alt="用户头像" class="avatar ms-2">
                </nav>
            </div>
        </div>
    </header>
    
    <!-- 主体内容区 -->
    <div class="main-content">
        <div class="container">
            <!-- 布局切换器 -->
            <div class="layout-switcher">
                <span class="switcher-label">动态视图：</span>
                <div class="view-options">
                    <button class="view-btn active" id="list-view" title="列表视图">
                        <i class="fas fa-list"></i>
                    </button>
                    <button class="view-btn" id="grid-view" title="网格视图">
                        <i class="fas fa-th"></i>
                    </button>
                    <button class="view-btn" id="compact-view" title="紧凑视图">
                        <i class="fas fa-align-left"></i>
                    </button>
                </div>
            </div>
            
            <!-- 动态流容器 -->
            <div class="feed-container" id="feed-container">
                <!-- 无图动态 -->
                <article class="feed-card list-card">
                    <div class="feed-header">
                        <img src="https://picsum.photos/100/100?random=10" alt="用户头像" class="avatar">
                        <div class="user-info">
                            <a href="#" class="user-name">城市规划师李明</a>
                            <div class="post-time">今天 08:30 · 来自网页版</div>
                        </div>
                        <button class="btn btn-sm text-gray-500">
                            <i class="fas fa-ellipsis-h"></i>
                        </button>
                    </div>
                    
                    <div class="feed-content">
                        <div class="post-text">
                            刚刚完成了城市中心公园的总体规划方案，历时三个月的努力终于有了成果。这个方案融合了生态保护、市民休闲和文化展示等多重功能，希望能为城市带来更多活力和绿色空间。接下来就是等待评审结果了，有点紧张又期待！
                        </div>
                        
                        <div class="feed-tags">
                            <a href="#" class="tag">#城市规划</a>
                            <a href="#" class="tag">#景观设计</a>
                            <a href="#" class="tag">#公共空间</a>
                        </div>
                    </div>
                    
                    <div class="feed-actions">
                        <button class="action-btn like-btn">
                            <i class="far fa-heart"></i>
                            <span class="action-text">点赞 (128)</span>
                        </button>
                        <button class="action-btn comment-btn">
                            <i class="far fa-comment"></i>
                            <span class="action-text">评论 (32)</span>
                        </button>
                        <button class="action-btn share-btn">
                            <i class="far fa-share-square"></i>
                            <span class="action-text">分享 (8)</span>
                        </button>
                        <button class="action-btn save-btn">
                            <i class="far fa-bookmark"></i>
                            <span class="action-text">收藏</span>
                        </button>
                    </div>
                </article>
                
                <!-- 单图动态 -->
                <article class="feed-card list-card">
                    <div class="feed-header">
                        <img src="https://picsum.photos/100/100?random=11" alt="用户头像" class="avatar">
                        <div class="user-info">
                            <a href="#" class="user-name">美食摄影师陈颖</a>
                            <div class="post-time">昨天 19:45 · 来自 iPhone</div>
                        </div>
                        <button class="btn btn-sm text-gray-500">
                            <i class="fas fa-ellipsis-h"></i>
                        </button>
                    </div>
                    
                    <div class="feed-content">
                        <div class="post-text">
                            今日探店：隐藏在老城区巷子里的一家私房菜馆，老板是位有三十年经验的老师傅，每道菜都透着匠心。这道松鼠鳜鱼外酥里嫩，酸甜汁调配得恰到好处，堪称一绝！
                        </div>
                        
                        <div class="post-images">
                            <div class="single-image">
                                <img src="https://picsum.photos/800/500?random=20" alt="松鼠鳜鱼美食照片">
                            </div>
                        </div>
                        
                        <div class="feed-tags">
                            <a href="#" class="tag">#美食探店</a>
                            <a href="#" class="tag">#传统菜肴</a>
                            <a href="#" class="tag">#城市美食地图</a>
                        </div>
                    </div>
                    
                    <div class="feed-actions">
                        <button class="action-btn like-btn liked">
                            <i class="fas fa-heart"></i>
                            <span class="action-text">点赞 (567)</span>
                        </button>
                        <button class="action-btn comment-btn">
                            <i class="far fa-comment"></i>
                            <span class="action-text">评论 (89)</span>
                        </button>
                        <button class="action-btn share-btn">
                            <i class="far fa-share-square"></i>
                            <span class="action-text">分享 (42)</span>
                        </button>
                        <button class="action-btn save-btn saved">
                            <i class="fas fa-bookmark"></i>
                            <span class="action-text">已收藏</span>
                        </button>
                    </div>
                </article>
                
                <!-- 双图动态 -->
                <article class="feed-card list-card">
                    <div class="feed-header">
                        <img src="https://picsum.photos/100/100?random=12" alt="用户头像" class="avatar">
                        <div class="user-info">
                            <a href="#" class="user-name">旅行博主王浩</a>
                            <div class="post-time">3天前 · 来自 Android</div>
                        </div>
                        <button class="btn btn-sm text-gray-500">
                            <i class="fas fa-ellipsis-h"></i>
                        </button>
                    </div>
                    
                    <div class="feed-content">
                        <div class="post-text">
                            徒步虎跳峡，感受大自然的磅礴力量。一边是悬崖峭壁，一边是奔腾的金沙江，每一步都充满挑战但也无比值得。图一是清晨的山间云雾，图二是俯瞰峡谷的壮观景色。
                        </div>
                        
                        <div class="post-images">
                            <div class="two-images">
                                <div class="image-item">
                                    <img src="https://picsum.photos/600/600?random=30" alt="山间云雾景观">
                                </div>
                                <div class="image-item">
                                    <img src="https://picsum.photos/600/600?random=31" alt="虎跳峡峡谷景观">
                                </div>
                            </div>
                        </div>
                        
                        <div class="feed-tags">
                            <a href="#" class="tag">#徒步旅行</a>
                            <a href="#" class="tag">#自然景观</a>
                            <a href="#" class="tag">#云南旅游</a>
                        </div>
                    </div>
                    
                    <div class="feed-actions">
                        <button class="action-btn like-btn">
                            <i class="far fa-heart"></i>
                            <span class="action-text">点赞 (324)</span>
                        </button>
                        <button class="action-btn comment-btn">
                            <i class="far fa-comment"></i>
                            <span class="action-text">评论 (56)</span>
                        </button>
                        <button class="action-btn share-btn">
                            <i class="far fa-share-square"></i>
                            <span class="action-text">分享 (29)</span>
                        </button>
                        <button class="action-btn save-btn">
                            <i class="far fa-bookmark"></i>
                            <span class="action-text">收藏</span>
                        </button>
                    </div>
                </article>
                
                <!-- 三图动态 -->
                <article class="feed-card list-card">
                    <div class="feed-header">
                        <img src="https://picsum.photos/100/100?random=13" alt="用户头像" class="avatar">
                        <div class="user-info">
                            <a href="#" class="user-name">室内设计师张雯</a>
                            <div class="post-time">4天前 · 来自 iPad</div>
                        </div>
                        <button class="btn btn-sm text-gray-500">
                            <i class="fas fa-ellipsis-h"></i>
                        </button>
                    </div>
                    
                    <div class="feed-content">
                        <div class="post-text">
                            最新完成的极简主义公寓设计，以白色和原木色为主调，通过材质的对比营造温馨而不失格调的居住空间。大面积的落地窗让自然光充分进入，使空间显得更加开阔明亮。
                        </div>
                        
                        <div class="post-images">
                            <div class="three-images">
                                <div class="image-item">
                                    <img src="https://picsum.photos/600/800?random=40" alt="客厅设计">
                                </div>
                                <div class="image-item">
                                    <img src="https://picsum.photos/600/400?random=41" alt="卧室设计">
                                </div>
                                <div class="image-item">
                                    <img src="https://picsum.photos/600/400?random=42" alt="厨房设计">
                                </div>
                            </div>
                        </div>
                        
                        <div class="feed-tags">
                            <a href="#" class="tag">#室内设计</a>
                            <a href="#" class="tag">#极简主义</a>
                            <a href="#" class="tag">#家居美学</a>
                        </div>
                    </div>
                    
                    <div class="feed-actions">
                        <button class="action-btn like-btn">
                            <i class="far fa-heart"></i>
                            <span class="action-text">点赞 (412)</span>
                        </button>
                        <button class="action-btn comment-btn">
                            <i class="far fa-comment"></i>
                            <span class="action-text">评论 (73)</span>
                        </button>
                        <button class="action-btn share-btn">
                            <i class="far fa-share-square"></i>
                            <span class="action-text">分享 (36)</span>
                        </button>
                        <button class="action-btn save-btn saved">
                            <i class="fas fa-bookmark"></i>
                            <span class="action-text">已收藏</span>
                        </button>
                    </div>
                </article>
                
                <!-- 四图动态 -->
                <article class="feed-card list-card">
                    <div class="feed-header">
                        <img src="https://picsum.photos/100/100?random=14" alt="用户头像" class="avatar">
                        <div class="user-info">
                            <a href="#" class="user-name">街头摄影师刘强</a>
                            <div class="post-time">5天前 · 来自相机</div>
                        </div>
                        <button class="btn btn-sm text-gray-500">
                            <i class="fas fa-ellipsis-h"></i>
                        </button>
                    </div>
                    
                    <div class="feed-content">
                        <div class="post-text">
                            周末的城市街头摄影合集，捕捉城市生活中的精彩瞬间。每一张照片背后都有一个故事，每一个瞬间都值得被记录。
                        </div>
                        
                        <div class="post-images">
                            <div class="four-images">
                                <div class="image-item">
                                    <img src="https://picsum.photos/600/600?random=50" alt="街头摄影1">
                                </div>
                                <div class="image-item">
                                    <img src="https://picsum.photos/600/600?random=51" alt="街头摄影2">
                                </div>
                                <div class="image-item">
                                    <img src="https://picsum.photos/600/600?random=52" alt="街头摄影3">
                                </div>
                                <div class="image-item">
                                    <img src="https://picsum.photos/600/600?random=53" alt="街头摄影4">
                                </div>
                            </div>
                        </div>
                        
                        <div class="feed-tags">
                            <a href="#" class="tag">#街头摄影</a>
                            <a href="#" class="tag">#城市生活</a>
                            <a href="#" class="tag">#人文纪实</a>
                        </div>
                    </div>
                    
                    <div class="feed-actions">
                        <button class="action-btn like-btn liked">
                            <i class="fas fa-heart"></i>
                            <span class="action-text">点赞 (621)</span>
                        </button>
                        <button class="action-btn comment-btn">
                            <i class="far fa-comment"></i>
                            <span class="action-text">评论 (94)</span>
                        </button>
                        <button class="action-btn share-btn">
                            <i class="far fa-share-square"></i>
                            <span class="action-text">分享 (58)</span>
                        </button>
                        <button class="action-btn save-btn">
                            <i class="far fa-bookmark"></i>
                            <span class="action-text">收藏</span>
                        </button>
                    </div>
                </article>
                
                <!-- 多图动态（5张以上） -->
                <article class="feed-card list-card">
                    <div class="feed-header">
                        <img src="https://picsum.photos/100/100?random=15" alt="用户头像" class="avatar">
                        <div class="user-info">
                            <a href="#" class="user-name">花艺设计师林小雨</a>
                            <div class="post-time">1周前 · 来自网页版</div>
                        </div>
                        <button class="btn btn-sm text-gray-500">
                            <i class="fas fa-ellipsis-h"></i>
                        </button>
                    </div>
                    
                    <div class="feed-content">
                        <div class="post-text">
                            春季花艺作品集，用鲜花传递春天的气息。包含了婚礼花艺、家居插花和商业空间花艺设计，每一款都充满了春日活力。
                        </div>
                        
                        <div class="post-images">
                            <div class="five-plus-images">
                                <div class="image-item">
                                    <img src="https://picsum.photos/600/600?random=60" alt="花艺设计1">
                                </div>
                                <div class="image-item">
                                    <img src="https://picsum.photos/600/600?random=61" alt="花艺设计2">
                                </div>
                                <div class="image-item">
                                    <img src="https://picsum.photos/600/600?random=62" alt="花艺设计3">
                                </div>
                                <div class="image-item">
                                    <img src="https://picsum.photos/600/600?random=63" alt="花艺设计4">
                                </div>
                                <div class="image-item">
                                    <img src="https://picsum.photos/600/600?random=64" alt="花艺设计5">
                                </div>
                                <div class="image-item">
                                    <img src="https://picsum.photos/600/600?random=65" alt="花艺设计6">
                                    <div class="image-overlay">+3</div>
                                </div>
                            </div>
                        </div>
                        
                        <div class="feed-tags">
                            <a href="#" class="tag">#花艺设计</a>
                            <a href="#" class="tag">#春季花艺</a>
                            <a href="#" class="tag">#婚礼布置</a>
                        </div>
                    </div>
                    
                    <div class="feed-actions">
                        <button class="action-btn like-btn">
                            <i class="far fa-heart"></i>
                            <span class="action-text">点赞 (289)</span>
                        </button>
                        <button class="action-btn comment-btn">
                            <i class="far fa-comment"></i>
                            <span class="action-text">评论 (47)</span>
                        </button>
                        <button class="action-btn share-btn">
                            <i class="far fa-share-square"></i>
                            <span class="action-text">分享 (23)</span>
                        </button>
                        <button class="action-btn save-btn saved">
                            <i class="fas fa-bookmark"></i>
                            <span class="action-text">已收藏</span>
                        </button>
                    </div>
                </article>
            </div>
            
            <!-- 加载更多 -->
            <div class="text-center mt-4 mb-5">
                <button class="btn btn-outline-primary px-5 py-2" id="load-more">
                    <i class="fas fa-spinner fa-spin me-2" style="display: none;"></i>
                    加载更多动态
                </button>
            </div>
        </div>
    </div>
    
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
    <script>
        // 布局切换功能
        const listViewBtn = document.getElementById('list-view');
        const gridViewBtn = document.getElementById('grid-view');
        const compactViewBtn = document.getElementById('compact-view');
        const feedContainer = document.getElementById('feed-container');
        const feedCards = document.querySelectorAll('.feed-card');
        
        // 切换到列表视图
        listViewBtn.addEventListener('click', function() {
            setActiveView(this);
            feedContainer.classList.remove('grid-layout', 'compact-layout');
            feedCards.forEach(card => {
                card.classList.remove('grid-card', 'compact-card');
                card.classList.add('list-card');
            });
        });
        
        // 切换到网格视图
        gridViewBtn.addEventListener('click', function() {
            setActiveView(this);
            feedContainer.classList.add('grid-layout');
            feedContainer.classList.remove('compact-layout');
            feedCards.forEach(card => {
                card.classList.add('grid-card');
                card.classList.remove('list-card', 'compact-card');
            });
        });
        
        // 切换到紧凑视图
        compactViewBtn.addEventListener('click', function() {
            setActiveView(this);
            feedContainer.classList.remove('grid-layout');
            feedContainer.classList.add('compact-layout');
            feedCards.forEach(card => {
                card.classList.remove('list-card', 'grid-card');
                card.classList.add('compact-card');
            });
        });
        
        // 设置当前激活的视图按钮
        function setActiveView(btn) {
            document.querySelectorAll('.view-btn').forEach(button => {
                button.classList.remove('active');
            });
            btn.classList.add('active');
        }
        
        // 点赞功能
        document.querySelectorAll('.like-btn').forEach(btn => {
            btn.addEventListener('click', function() {
                this.classList.toggle('liked');
                const icon = this.querySelector('i');
                const text = this.querySelector('.action-text').textContent;
                const count = parseInt(text.match(/\d+/)[0]);
                
                if (this.classList.contains('liked')) {
                    icon.classList.remove('far');
                    icon.classList.add('fas');
                    this.querySelector('.action-text').textContent = `点赞 (${count + 1})`;
                } else {
                    icon.classList.remove('fas');
                    icon.classList.add('far');
                    this.querySelector('.action-text').textContent = `点赞 (${count - 1})`;
                }
            });
        });
        
        // 收藏功能
        document.querySelectorAll('.save-btn').forEach(btn => {
            btn.addEventListener('click', function() {
                this.classList.toggle('saved');
                const icon = this.querySelector('i');
                
                if (this.classList.contains('saved')) {
                    icon.classList.remove('far');
                    icon.classList.add('fas');
                    this.querySelector('.action-text').textContent = '已收藏';
                } else {
                    icon.classList.remove('fas');
                    icon.classList.add('far');
                    this.querySelector('.action-text').textContent = '收藏';
                }
            });
        });
        
        // 评论和分享功能
        document.querySelectorAll('.comment-btn').forEach(btn => {
            btn.addEventListener('click', function() {
                const countText = this.querySelector('.action-text').textContent;
                const count = parseInt(countText.match(/\d+/)[0]);
                alert(`查看 ${count} 条评论`);
            });
        });
        
        document.querySelectorAll('.share-btn').forEach(btn => {
            btn.addEventListener('click', function() {
                alert('分享选项已打开');
            });
        });
        
        // 加载更多功能
        document.getElementById('load-more').addEventListener('click', function() {
            const spinner = this.querySelector('.fa-spinner');
            spinner.style.display = 'inline-block';
            this.disabled = true;
            
            // 模拟加载延迟
            setTimeout(() => {
                spinner.style.display = 'none';
                this.disabled = false;
                alert('已加载全部动态');
            }, 1500);
        });
    </script>
</body>
</html>
    
